/**
 * 
 */
package persistence.test;

import java.math.BigDecimal;

import persistence.annotation.Column;
import persistence.annotation.Id;
import persistence.annotation.ManyToOne;
import persistence.annotation.Table;

/**
 * @author dga
 * 
 */
@Table(name = "book")
public class Book {

	private String title;
	private Long id;
	private BigDecimal price;
	private Category category;

	@Id
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "price", type = "DECIMAL(10,2)")
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@ManyToOne
	@Column(name = "category", type = "BIGINT")
	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Book [category=" + category + ", id=" + id + ", price=" + price + ", title=" + title + "]";
	}

}
